package com.license.logic.pso;

import java.util.List;

import com.license.logic.alimentation.Alimentation;
import com.license.logic.alimentation.Food;
import com.license.logic.preference.Activity;

public class Position {


	private Alimentation alimentation ;
	private List<Activity> activities;
	private double weight;
	
	public Alimentation getAlimentation() {
		return alimentation;
	}
	public void setAlimentation(Alimentation alimentation) {
		this.alimentation = alimentation;
	}
	public List<Activity> getActivities() {
		return activities;
	}
	public void setActivities(List<Activity> activities) {
		this.activities = activities;
	}
	public double getAllCalories(){
		double value = 0;
		for(Activity activity : activities) {
			value -= activity.getKaloriesConsumed();
		}
		for(Food food : getAlimentation().getBreakFast()) {
			value += food.getKaloriesGain();
		}
		for(Food food : getAlimentation().getDinner()) {
			value += food.getKaloriesGain();
		}
		for(Food food : getAlimentation().getLunch()) {
			value += food.getKaloriesGain();
		}
		for(Food food : getAlimentation().getSnack()) {
			value += food.getKaloriesGain();
		}
		return value;
	}
	
	@Override
	public String toString() {
	
		String particle="" ;
		for(Activity activity : activities) {
			System.out.println("Activities \n --------");
			System.out.println(activity.getName()+ " == calories == " + activity.getKaloriesConsumed() + "\n");
			System.out.println("minutes: " + activity.getMinutes());
			System.out.println("kalories: " + activity.getKalories());
			System.out.println("kg :" + activity.getKg());
		}
		for(Food food : getAlimentation().getBreakFast()) {
			System.out.println("BreakFast food \n --------");
			System.out.println(food.getName()+ " == calories == " + food.getKaloriesGain() + "\n");
			System.out.println(food.getPortions());
//			System.out.println(food.getCharacteristics().getKalory());
//			System.out.println(food.getCharacteristics().getGramsPerPortion());
		}
		for(Food food : getAlimentation().getDinner()) {
			System.out.println("DinnerFast food \n --------");
			System.out.println(food.getName()+ " == calories == " + food.getKaloriesGain() + "\n");
			System.out.println(food.getPortions());
//			System.out.println(food.getCharacteristics().getKalory());
//			System.out.println(food.getCharacteristics().getGramsPerPortion());
		}
		for(Food food : getAlimentation().getLunch()) {
			System.out.println("LaunchFast food \n --------");
			System.out.println(food.getName()+ " == calories == " + food.getKaloriesGain() + "\n");
			System.out.println(food.getPortions());
//			System.out.println(food.getCharacteristics().getKalory());
//			System.out.println(food.getCharacteristics().getGramsPerPortion());
		}
		for(Food food : getAlimentation().getSnack()) {
			System.out.println("SanchFast food \n --------");
			System.out.println(food.getName()+ " == calories == " + food.getKaloriesGain() + "\n");
			System.out.println(food.getPortions());
//			System.out.println(food.getCharacteristics().getKalory());
//			System.out.println(food.getCharacteristics().getGramsPerPortion());
		}
		
		System.out.println("ideal calories per day to gain the desire weight according to alimentation and acitivites for this position: " + getAllCalories());
		return particle;
	}
	public double getWeight() {
		return weight;
	}
	public void setWeight(double weight) {
		this.weight = weight;
	}
	
	
}
